
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>官方Shell · 这是程序员吗</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="xishengcai">
        
        
    
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-toggle-chapters/toggle.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-disqus/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-prism/prism-base16-ateliersulphurpool.light.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-advanced-emoji/emoji-website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-katex/katex.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-sectionx/sectionx.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-donate/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-local-video/video-js.min.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-anchor-navigation-ex/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-terminal/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-alerts/style.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-versions-select/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-theme-comscore/test.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    


    

        
    
    
    
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../golang/" />
    
    
    <link rel="prev" href="readme.html" />
    

    
    <link rel="stylesheet" href="../../gitbook/gitbook-plugin-chart/c3/c3.min.css">
    <script src="../../gitbook/gitbook-plugin-chart/c3/d3.min.js"></script>
    <script src="../../gitbook/gitbook-plugin-chart/c3/c3.min.js"></script>
    

    <script src="../../gitbook/gitbook-plugin-graph/d3.min.js"></script>
    <script src="../../gitbook/gitbook-plugin-graph/function-plot.js"></script>    

    
        <link rel="shortcut icon" href='../../favicon.ico' type="image/x-icon">
    
    
        <link rel="bookmark" href='../../favicon.ico' type="image/x-icon">
    
    
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"repo":"xishengcai/xisheng.blog","types":["star"],"size":"small"};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://xisheng.vip" target="_blank" class="custom-link">Home</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        <li class="header">Blog</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                        <b>1.1.</b>
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../algorithm/">
            
                <a href="../algorithm/">
            
                    
                        <b>1.2.</b>
                    
                    Algorithm
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../algorithm/heap.html">
            
                <a href="../algorithm/heap.html">
            
                    
                        <b>1.2.1.</b>
                    
                    Heap
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../algorithm/readme.html">
            
                <a href="../algorithm/readme.html">
            
                    
                        <b>1.2.2.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../angular/">
            
                <a href="../angular/">
            
                    
                        <b>1.3.</b>
                    
                    Angular
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../angular/1-start.html">
            
                <a href="../angular/1-start.html">
            
                    
                        <b>1.3.1.</b>
                    
                    Start
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../angular/2-component.html">
            
                <a href="../angular/2-component.html">
            
                    
                        <b>1.3.2.</b>
                    
                    Component
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../angular/3-form.html">
            
                <a href="../angular/3-form.html">
            
                    
                        <b>1.3.3.</b>
                    
                    Form
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../angular/readme.html">
            
                <a href="../angular/readme.html">
            
                    
                        <b>1.3.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../database/">
            
                <a href="../database/">
            
                    
                        <b>1.4.</b>
                    
                    Database
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../database/mongodb.html">
            
                <a href="../database/mongodb.html">
            
                    
                        <b>1.4.1.</b>
                    
                    Mongodb
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../database/readme.html">
            
                <a href="../database/readme.html">
            
                    
                        <b>1.4.2.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="./">
            
                <a href="./">
            
                    
                        <b>1.5.</b>
                    
                    Docker
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="CentOS.html">
            
                <a href="CentOS.html">
            
                    
                        <b>1.5.1.</b>
                    
                    CentOS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="install.html">
            
                <a href="install.html">
            
                    
                        <b>1.5.2.</b>
                    
                    Install
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="readme.html">
            
                <a href="readme.html">
            
                    
                        <b>1.5.3.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.5.4" data-path="官方shell.html">
            
                <a href="官方shell.html">
            
                    
                        <b>1.5.4.</b>
                    
                    官方Shell
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../golang/">
            
                <a href="../golang/">
            
                    
                        <b>1.6.</b>
                    
                    Golang
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../golang/aop.html">
            
                <a href="../golang/aop.html">
            
                    
                        <b>1.6.1.</b>
                    
                    Aop
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../golang/base/">
            
                <a href="../golang/base/">
            
                    
                        <b>1.6.2.</b>
                    
                    Base
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.2.1" data-path="../golang/base/copy.html">
            
                <a href="../golang/base/copy.html">
            
                    
                        <b>1.6.2.1.</b>
                    
                    Copy
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.2" data-path="../golang/base/new_and_make.html">
            
                <a href="../golang/base/new_and_make.html">
            
                    
                        <b>1.6.2.2.</b>
                    
                    New And Make
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.3" data-path="../golang/base/readme.html">
            
                <a href="../golang/base/readme.html">
            
                    
                        <b>1.6.2.3.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.4" data-path="../golang/base/reflect.html">
            
                <a href="../golang/base/reflect.html">
            
                    
                        <b>1.6.2.4.</b>
                    
                    Reflect
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.5" data-path="../golang/base/string.html">
            
                <a href="../golang/base/string.html">
            
                    
                        <b>1.6.2.5.</b>
                    
                    String
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.6" data-path="../golang/base/tag.html">
            
                <a href="../golang/base/tag.html">
            
                    
                        <b>1.6.2.6.</b>
                    
                    Tag
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../golang/clouser.html">
            
                <a href="../golang/clouser.html">
            
                    
                        <b>1.6.3.</b>
                    
                    Clouser
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../golang/err 优雅处理.html">
            
                <a href="../golang/err 优雅处理.html">
            
                    
                        <b>1.6.4.</b>
                    
                    Err 优雅处理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../golang/go module 2.html">
            
                <a href="../golang/go module 2.html">
            
                    
                        <b>1.6.5.</b>
                    
                    Go Module 2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../golang/go_mod.html">
            
                <a href="../golang/go_mod.html">
            
                    
                        <b>1.6.6.</b>
                    
                    Go Mod
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../golang/gocraftwork.html">
            
                <a href="../golang/gocraftwork.html">
            
                    
                        <b>1.6.7.</b>
                    
                    Gocraftwork
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="../golang/oauth.html">
            
                <a href="../golang/oauth.html">
            
                    
                        <b>1.6.8.</b>
                    
                    Oauth
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../golang/readme.html">
            
                <a href="../golang/readme.html">
            
                    
                        <b>1.6.9.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10" data-path="../golang/swagger.html">
            
                <a href="../golang/swagger.html">
            
                    
                        <b>1.6.10.</b>
                    
                    Swagger
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11" data-path="../golang/tls.html">
            
                <a href="../golang/tls.html">
            
                    
                        <b>1.6.11.</b>
                    
                    Tls
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.12" >
            
                <span>
            
                    
                        <b>1.6.12.</b>
                    
                    代码走读
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.12.1" data-path="../golang/代码走读/2020.5.26.html">
            
                <a href="../golang/代码走读/2020.5.26.html">
            
                    
                        <b>1.6.12.1.</b>
                    
                    2020.5.26
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.13" data-path="../golang/任务队列/">
            
                <a href="../golang/任务队列/">
            
                    
                        <b>1.6.13.</b>
                    
                    任务队列
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.13.1" data-path="../golang/任务队列/gocraft-worker.html">
            
                <a href="../golang/任务队列/gocraft-worker.html">
            
                    
                        <b>1.6.13.1.</b>
                    
                    Gocraft Worker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.13.2" data-path="../golang/任务队列/readme.html">
            
                <a href="../golang/任务队列/readme.html">
            
                    
                        <b>1.6.13.2.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.14" data-path="../golang/参数校验.html">
            
                <a href="../golang/参数校验.html">
            
                    
                        <b>1.6.14.</b>
                    
                    参数校验
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../istio/">
            
                <a href="../istio/">
            
                    
                        <b>1.7.</b>
                    
                    Istio
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../istio/readme.html">
            
                <a href="../istio/readme.html">
            
                    
                        <b>1.7.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../istio/virtualservice.html">
            
                <a href="../istio/virtualservice.html">
            
                    
                        <b>1.7.2.</b>
                    
                    Virtualservice
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" >
            
                <span>
            
                    
                        <b>1.8.</b>
                    
                    Java
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../java/jvm.html">
            
                <a href="../java/jvm.html">
            
                    
                        <b>1.8.1.</b>
                    
                    Jvm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../java/typescript.html">
            
                <a href="../java/typescript.html">
            
                    
                        <b>1.8.2.</b>
                    
                    Typescript
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../kubernetes/">
            
                <a href="../kubernetes/">
            
                    
                        <b>1.9.</b>
                    
                    Kubernetes
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" data-path="../kubernetes/APIService.html">
            
                <a href="../kubernetes/APIService.html">
            
                    
                        <b>1.9.1.</b>
                    
                    APIService
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" data-path="../kubernetes/CAK.html">
            
                <a href="../kubernetes/CAK.html">
            
                    
                        <b>1.9.2.</b>
                    
                    CAK
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" data-path="../kubernetes/Deployment 的实现原理.html">
            
                <a href="../kubernetes/Deployment 的实现原理.html">
            
                    
                        <b>1.9.3.</b>
                    
                    Deployment 的实现原理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" data-path="../kubernetes/K8s源码/">
            
                <a href="../kubernetes/K8s源码/">
            
                    
                        <b>1.9.4.</b>
                    
                    K8s源码
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.4.1" data-path="../kubernetes/K8s源码/calico 源码分析.html">
            
                <a href="../kubernetes/K8s源码/calico 源码分析.html">
            
                    
                        <b>1.9.4.1.</b>
                    
                    Calico 源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.2" data-path="../kubernetes/K8s源码/garbage collector controller 源码分析.html">
            
                <a href="../kubernetes/K8s源码/garbage collector controller 源码分析.html">
            
                    
                        <b>1.9.4.2.</b>
                    
                    Garbage Collector Controller 源码分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.3" data-path="../kubernetes/K8s源码/job.html">
            
                <a href="../kubernetes/K8s源码/job.html">
            
                    
                        <b>1.9.4.3.</b>
                    
                    Job
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.4" data-path="../kubernetes/K8s源码/kube-proxy-iptables.html">
            
                <a href="../kubernetes/K8s源码/kube-proxy-iptables.html">
            
                    
                        <b>1.9.4.4.</b>
                    
                    Kube Proxy Iptables
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.5" data-path="../kubernetes/K8s源码/kube-proxy-ipvs.html">
            
                <a href="../kubernetes/K8s源码/kube-proxy-ipvs.html">
            
                    
                        <b>1.9.4.5.</b>
                    
                    Kube Proxy Ipvs
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.6" data-path="../kubernetes/K8s源码/kube-proxy.html">
            
                <a href="../kubernetes/K8s源码/kube-proxy.html">
            
                    
                        <b>1.9.4.6.</b>
                    
                    Kube Proxy
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.7" data-path="../kubernetes/K8s源码/kubectl-exec.html">
            
                <a href="../kubernetes/K8s源码/kubectl-exec.html">
            
                    
                        <b>1.9.4.7.</b>
                    
                    Kubectl Exec
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.8" data-path="../kubernetes/K8s源码/kubectl源码阅读1.html">
            
                <a href="../kubernetes/K8s源码/kubectl源码阅读1.html">
            
                    
                        <b>1.9.4.8.</b>
                    
                    Kubectl源码阅读1
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.9" data-path="../kubernetes/K8s源码/kubectl源码阅读2.html">
            
                <a href="../kubernetes/K8s源码/kubectl源码阅读2.html">
            
                    
                        <b>1.9.4.9.</b>
                    
                    Kubectl源码阅读2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.10" data-path="../kubernetes/K8s源码/readme.html">
            
                <a href="../kubernetes/K8s源码/readme.html">
            
                    
                        <b>1.9.4.10.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.11" data-path="../kubernetes/K8s源码/schedule.html">
            
                <a href="../kubernetes/K8s源码/schedule.html">
            
                    
                        <b>1.9.4.11.</b>
                    
                    Schedule
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.12" data-path="../kubernetes/K8s源码/scheme.html">
            
                <a href="../kubernetes/K8s源码/scheme.html">
            
                    
                        <b>1.9.4.12.</b>
                    
                    Scheme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4.13" data-path="../kubernetes/K8s源码/调度队列.html">
            
                <a href="../kubernetes/K8s源码/调度队列.html">
            
                    
                        <b>1.9.4.13.</b>
                    
                    调度队列
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.5" data-path="../kubernetes/Karmada.html">
            
                <a href="../kubernetes/Karmada.html">
            
                    
                        <b>1.9.5.</b>
                    
                    Karmada
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.6" data-path="../kubernetes/Pixie.html">
            
                <a href="../kubernetes/Pixie.html">
            
                    
                        <b>1.9.6.</b>
                    
                    Pixie
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.7" data-path="../kubernetes/admission access.html">
            
                <a href="../kubernetes/admission access.html">
            
                    
                        <b>1.9.7.</b>
                    
                    Admission Access
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.8" data-path="../kubernetes/ccm.html">
            
                <a href="../kubernetes/ccm.html">
            
                    
                        <b>1.9.8.</b>
                    
                    Ccm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.9" data-path="../kubernetes/client-go.html">
            
                <a href="../kubernetes/client-go.html">
            
                    
                        <b>1.9.9.</b>
                    
                    Client Go
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.10" data-path="../kubernetes/command.html">
            
                <a href="../kubernetes/command.html">
            
                    
                        <b>1.9.10.</b>
                    
                    Command
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.11" data-path="../kubernetes/controller.html">
            
                <a href="../kubernetes/controller.html">
            
                    
                        <b>1.9.11.</b>
                    
                    Controller
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.12" data-path="../kubernetes/copy docker config.html">
            
                <a href="../kubernetes/copy docker config.html">
            
                    
                        <b>1.9.12.</b>
                    
                    Copy Docker Config
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.13" data-path="../kubernetes/etcd-operation.html">
            
                <a href="../kubernetes/etcd-operation.html">
            
                    
                        <b>1.9.13.</b>
                    
                    Etcd Operation
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.14" data-path="../kubernetes/gc.html">
            
                <a href="../kubernetes/gc.html">
            
                    
                        <b>1.9.14.</b>
                    
                    Gc
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.15" data-path="../kubernetes/helm chart.html">
            
                <a href="../kubernetes/helm chart.html">
            
                    
                        <b>1.9.15.</b>
                    
                    Helm Chart
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.16" data-path="../kubernetes/helm.html">
            
                <a href="../kubernetes/helm.html">
            
                    
                        <b>1.9.16.</b>
                    
                    Helm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17" >
            
                <span>
            
                    
                        <b>1.9.17.</b>
                    
                    Helm
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.17.1" data-path="../kubernetes/helm/charts.html">
            
                <a href="../kubernetes/helm/charts.html">
            
                    
                        <b>1.9.17.1.</b>
                    
                    Charts
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17.2" data-path="../kubernetes/helm/helm 钩子函数.html">
            
                <a href="../kubernetes/helm/helm 钩子函数.html">
            
                    
                        <b>1.9.17.2.</b>
                    
                    Helm 钩子函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17.3" data-path="../kubernetes/helm/helm-operator.html">
            
                <a href="../kubernetes/helm/helm-operator.html">
            
                    
                        <b>1.9.17.3.</b>
                    
                    Helm Operator
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17.4" data-path="../kubernetes/helm/文档查询.html">
            
                <a href="../kubernetes/helm/文档查询.html">
            
                    
                        <b>1.9.17.4.</b>
                    
                    文档查询
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.17.5" data-path="../kubernetes/helm/语法.html">
            
                <a href="../kubernetes/helm/语法.html">
            
                    
                        <b>1.9.17.5.</b>
                    
                    语法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.18" data-path="../kubernetes/install.html">
            
                <a href="../kubernetes/install.html">
            
                    
                        <b>1.9.18.</b>
                    
                    Install
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.19" data-path="../kubernetes/istio-inject.html">
            
                <a href="../kubernetes/istio-inject.html">
            
                    
                        <b>1.9.19.</b>
                    
                    Istio Inject
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.20" >
            
                <span>
            
                    
                        <b>1.9.20.</b>
                    
                    KubeEdge
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.21" data-path="../kubernetes/kuber-apiserver-flag.html">
            
                <a href="../kubernetes/kuber-apiserver-flag.html">
            
                    
                        <b>1.9.21.</b>
                    
                    Kuber Apiserver Flag
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.22" data-path="../kubernetes/kubernetes-client.html">
            
                <a href="../kubernetes/kubernetes-client.html">
            
                    
                        <b>1.9.22.</b>
                    
                    Kubernetes Client
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.23" data-path="../kubernetes/kubernetes灾备.html">
            
                <a href="../kubernetes/kubernetes灾备.html">
            
                    
                        <b>1.9.23.</b>
                    
                    Kubernetes灾备
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.24" data-path="../kubernetes/kubesphere/">
            
                <a href="../kubernetes/kubesphere/">
            
                    
                        <b>1.9.24.</b>
                    
                    Kubesphere
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.24.1" data-path="../kubernetes/kubesphere/helm.html">
            
                <a href="../kubernetes/kubesphere/helm.html">
            
                    
                        <b>1.9.24.1.</b>
                    
                    Helm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.24.2" data-path="../kubernetes/kubesphere/readme.html">
            
                <a href="../kubernetes/kubesphere/readme.html">
            
                    
                        <b>1.9.24.2.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.25" data-path="../kubernetes/kubevela/">
            
                <a href="../kubernetes/kubevela/">
            
                    
                        <b>1.9.25.</b>
                    
                    Kubevela
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.25.1" data-path="../kubernetes/kubevela/KubeVela 功能.html">
            
                <a href="../kubernetes/kubevela/KubeVela 功能.html">
            
                    
                        <b>1.9.25.1.</b>
                    
                    KubeVela 功能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.2" data-path="../kubernetes/kubevela/cue.html">
            
                <a href="../kubernetes/kubevela/cue.html">
            
                    
                        <b>1.9.25.2.</b>
                    
                    Cue
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.3" data-path="../kubernetes/kubevela/oam.html">
            
                <a href="../kubernetes/kubevela/oam.html">
            
                    
                        <b>1.9.25.3.</b>
                    
                    Oam
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.4" data-path="../kubernetes/kubevela/readme.html">
            
                <a href="../kubernetes/kubevela/readme.html">
            
                    
                        <b>1.9.25.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.5" data-path="../kubernetes/kubevela/rollout design.html">
            
                <a href="../kubernetes/kubevela/rollout design.html">
            
                    
                        <b>1.9.25.5.</b>
                    
                    Rollout Design
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.6" data-path="../kubernetes/kubevela/vela run.html">
            
                <a href="../kubernetes/kubevela/vela run.html">
            
                    
                        <b>1.9.25.6.</b>
                    
                    Vela Run
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.7" data-path="../kubernetes/kubevela/vela up.html">
            
                <a href="../kubernetes/kubevela/vela up.html">
            
                    
                        <b>1.9.25.7.</b>
                    
                    Vela Up
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.8" data-path="../kubernetes/kubevela/vela-cluster.html">
            
                <a href="../kubernetes/kubevela/vela-cluster.html">
            
                    
                        <b>1.9.25.8.</b>
                    
                    Vela Cluster
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.9" data-path="../kubernetes/kubevela/vela-helm.html">
            
                <a href="../kubernetes/kubevela/vela-helm.html">
            
                    
                        <b>1.9.25.9.</b>
                    
                    Vela Helm
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.25.10" data-path="../kubernetes/kubevela/vela-pk-oam.html">
            
                <a href="../kubernetes/kubevela/vela-pk-oam.html">
            
                    
                        <b>1.9.25.10.</b>
                    
                    Vela Pk Oam
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.26" data-path="../kubernetes/mk-cert.html">
            
                <a href="../kubernetes/mk-cert.html">
            
                    
                        <b>1.9.26.</b>
                    
                    Mk Cert
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.27" data-path="../kubernetes/open_swagger-ui.html">
            
                <a href="../kubernetes/open_swagger-ui.html">
            
                    
                        <b>1.9.27.</b>
                    
                    Open Swagger Ui
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.28" data-path="../kubernetes/readme.html">
            
                <a href="../kubernetes/readme.html">
            
                    
                        <b>1.9.28.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29" data-path="../kubernetes/task/">
            
                <a href="../kubernetes/task/">
            
                    
                        <b>1.9.29.</b>
                    
                    Task
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.29.1" data-path="../kubernetes/task/HPA.html">
            
                <a href="../kubernetes/task/HPA.html">
            
                    
                        <b>1.9.29.1.</b>
                    
                    HPA
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.2" data-path="../kubernetes/task/kubectl patch.html">
            
                <a href="../kubernetes/task/kubectl patch.html">
            
                    
                        <b>1.9.29.2.</b>
                    
                    Kubectl Patch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.3" data-path="../kubernetes/task/pod 信息注入.html">
            
                <a href="../kubernetes/task/pod 信息注入.html">
            
                    
                        <b>1.9.29.3.</b>
                    
                    Pod 信息注入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.4" data-path="../kubernetes/task/pod 垂直扩缩容.html">
            
                <a href="../kubernetes/task/pod 垂直扩缩容.html">
            
                    
                        <b>1.9.29.4.</b>
                    
                    Pod 垂直扩缩容
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.5" data-path="../kubernetes/task/readme.html">
            
                <a href="../kubernetes/task/readme.html">
            
                    
                        <b>1.9.29.5.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.6" data-path="../kubernetes/task/server-side-apply.html">
            
                <a href="../kubernetes/task/server-side-apply.html">
            
                    
                        <b>1.9.29.6.</b>
                    
                    Server Side Apply
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.7" data-path="../kubernetes/task/准入控制.html">
            
                <a href="../kubernetes/task/准入控制.html">
            
                    
                        <b>1.9.29.7.</b>
                    
                    准入控制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.8" data-path="../kubernetes/task/聚合api.html">
            
                <a href="../kubernetes/task/聚合api.html">
            
                    
                        <b>1.9.29.8.</b>
                    
                    聚合Api
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.29.9" data-path="../kubernetes/task/资源预留配置.html">
            
                <a href="../kubernetes/task/资源预留配置.html">
            
                    
                        <b>1.9.29.9.</b>
                    
                    资源预留配置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.30" data-path="../kubernetes/webhook.html">
            
                <a href="../kubernetes/webhook.html">
            
                    
                        <b>1.9.30.</b>
                    
                    Webhook
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.31" data-path="../kubernetes/一致性认证.html">
            
                <a href="../kubernetes/一致性认证.html">
            
                    
                        <b>1.9.31.</b>
                    
                    一致性认证
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.32" data-path="../kubernetes/专利名词.html">
            
                <a href="../kubernetes/专利名词.html">
            
                    
                        <b>1.9.32.</b>
                    
                    专利名词
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.33" data-path="../kubernetes/删除namespace.html">
            
                <a href="../kubernetes/删除namespace.html">
            
                    
                        <b>1.9.33.</b>
                    
                    删除Namespace
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.34" data-path="../kubernetes/简化多集群.html">
            
                <a href="../kubernetes/简化多集群.html">
            
                    
                        <b>1.9.34.</b>
                    
                    简化多集群
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.35" data-path="../kubernetes/网络插件/">
            
                <a href="../kubernetes/网络插件/">
            
                    
                        <b>1.9.35.</b>
                    
                    网络插件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.35.1" data-path="../kubernetes/网络插件/calico.html">
            
                <a href="../kubernetes/网络插件/calico.html">
            
                    
                        <b>1.9.35.1.</b>
                    
                    Calico
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.35.2" data-path="../kubernetes/网络插件/cilium.html">
            
                <a href="../kubernetes/网络插件/cilium.html">
            
                    
                        <b>1.9.35.2.</b>
                    
                    Cilium
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.35.3" data-path="../kubernetes/网络插件/ebpf.html">
            
                <a href="../kubernetes/网络插件/ebpf.html">
            
                    
                        <b>1.9.35.3.</b>
                    
                    Ebpf
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.35.4" data-path="../kubernetes/网络插件/readme.html">
            
                <a href="../kubernetes/网络插件/readme.html">
            
                    
                        <b>1.9.35.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.36" data-path="../kubernetes/镜像/">
            
                <a href="../kubernetes/镜像/">
            
                    
                        <b>1.9.36.</b>
                    
                    镜像
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.36.1" data-path="../kubernetes/镜像/Containerd Stargz Snapshotter.html">
            
                <a href="../kubernetes/镜像/Containerd Stargz Snapshotter.html">
            
                    
                        <b>1.9.36.1.</b>
                    
                    Containerd Stargz Snapshotter
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.2" data-path="../kubernetes/镜像/OCI.html">
            
                <a href="../kubernetes/镜像/OCI.html">
            
                    
                        <b>1.9.36.2.</b>
                    
                    OCI
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.3" data-path="../kubernetes/镜像/harbor/">
            
                <a href="../kubernetes/镜像/harbor/">
            
                    
                        <b>1.9.36.3.</b>
                    
                    Harbor
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.36.3.1" data-path="../kubernetes/镜像/harbor/readme.html">
            
                <a href="../kubernetes/镜像/harbor/readme.html">
            
                    
                        <b>1.9.36.3.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9.36.4" data-path="../kubernetes/镜像/readme.html">
            
                <a href="../kubernetes/镜像/readme.html">
            
                    
                        <b>1.9.36.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.5" data-path="../kubernetes/镜像/自动构建镜像.html">
            
                <a href="../kubernetes/镜像/自动构建镜像.html">
            
                    
                        <b>1.9.36.5.</b>
                    
                    自动构建镜像
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.6" data-path="../kubernetes/镜像/镜像加速方案.html">
            
                <a href="../kubernetes/镜像/镜像加速方案.html">
            
                    
                        <b>1.9.36.6.</b>
                    
                    镜像加速方案
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.36.7" data-path="../kubernetes/镜像/镜像延迟加载技术解析.html">
            
                <a href="../kubernetes/镜像/镜像延迟加载技术解析.html">
            
                    
                        <b>1.9.36.7.</b>
                    
                    镜像延迟加载技术解析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../math/">
            
                <a href="../math/">
            
                    
                        <b>1.10.</b>
                    
                    Math
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" data-path="../math/readme.html">
            
                <a href="../math/readme.html">
            
                    
                        <b>1.10.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" data-path="../math/泊松分布.html">
            
                <a href="../math/泊松分布.html">
            
                    
                        <b>1.10.2.</b>
                    
                    泊松分布
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../效率/">
            
                <a href="../效率/">
            
                    
                        <b>1.11.</b>
                    
                    效率
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.11.1" data-path="../效率/cat.html">
            
                <a href="../效率/cat.html">
            
                    
                        <b>1.11.1.</b>
                    
                    Cat
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.2" data-path="../效率/docker volume clean.html">
            
                <a href="../效率/docker volume clean.html">
            
                    
                        <b>1.11.2.</b>
                    
                    Docker Volume Clean
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.3" data-path="../效率/git book.html">
            
                <a href="../效率/git book.html">
            
                    
                        <b>1.11.3.</b>
                    
                    Git Book
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.4" data-path="../效率/git.html">
            
                <a href="../效率/git.html">
            
                    
                        <b>1.11.4.</b>
                    
                    Git
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.5" data-path="../效率/linux command.html">
            
                <a href="../效率/linux command.html">
            
                    
                        <b>1.11.5.</b>
                    
                    Linux Command
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.6" data-path="../效率/linux 内核.html">
            
                <a href="../效率/linux 内核.html">
            
                    
                        <b>1.11.6.</b>
                    
                    Linux 内核
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.7" data-path="../效率/macos path.html">
            
                <a href="../效率/macos path.html">
            
                    
                        <b>1.11.7.</b>
                    
                    Macos Path
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.8" data-path="../效率/nfs.html">
            
                <a href="../效率/nfs.html">
            
                    
                        <b>1.11.8.</b>
                    
                    Nfs
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.9" data-path="../效率/nginx.html">
            
                <a href="../效率/nginx.html">
            
                    
                        <b>1.11.9.</b>
                    
                    Nginx
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.10" data-path="../效率/nginx2.html">
            
                <a href="../效率/nginx2.html">
            
                    
                        <b>1.11.10.</b>
                    
                    Nginx2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.11" data-path="../效率/oauth2.html">
            
                <a href="../效率/oauth2.html">
            
                    
                        <b>1.11.11.</b>
                    
                    Oauth2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.12" data-path="../效率/ovftool.html">
            
                <a href="../效率/ovftool.html">
            
                    
                        <b>1.11.12.</b>
                    
                    Ovftool
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.13" data-path="../效率/readme.html">
            
                <a href="../效率/readme.html">
            
                    
                        <b>1.11.13.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.14" data-path="../效率/sed.html">
            
                <a href="../效率/sed.html">
            
                    
                        <b>1.11.14.</b>
                    
                    Sed
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.15" data-path="../效率/shell_judge.html">
            
                <a href="../效率/shell_judge.html">
            
                    
                        <b>1.11.15.</b>
                    
                    Shell Judge
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.16" data-path="../效率/sshpass.html">
            
                <a href="../效率/sshpass.html">
            
                    
                        <b>1.11.16.</b>
                    
                    Sshpass
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.17" data-path="../效率/telepresence.html">
            
                <a href="../效率/telepresence.html">
            
                    
                        <b>1.11.17.</b>
                    
                    Telepresence
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.18" data-path="../效率/typora.html">
            
                <a href="../效率/typora.html">
            
                    
                        <b>1.11.18.</b>
                    
                    Typora
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.19" data-path="../效率/url encode.html">
            
                <a href="../效率/url encode.html">
            
                    
                        <b>1.11.19.</b>
                    
                    Url Encode
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.20" data-path="../效率/vim.html">
            
                <a href="../效率/vim.html">
            
                    
                        <b>1.11.20.</b>
                    
                    Vim
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.21" data-path="../效率/yum.html">
            
                <a href="../效率/yum.html">
            
                    
                        <b>1.11.21.</b>
                    
                    Yum
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.22" data-path="../效率/内网穿透.html">
            
                <a href="../效率/内网穿透.html">
            
                    
                        <b>1.11.22.</b>
                    
                    内网穿透
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.23" data-path="../效率/科学上网.html">
            
                <a href="../效率/科学上网.html">
            
                    
                        <b>1.11.23.</b>
                    
                    科学上网
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11.24" data-path="../效率/证书制作.html">
            
                <a href="../效率/证书制作.html">
            
                    
                        <b>1.11.24.</b>
                    
                    证书制作
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.12" >
            
                <span>
            
                    
                        <b>1.12.</b>
                    
                    杂谈
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.12.1" data-path="../杂谈/论好文章和烂文章.html">
            
                <a href="../杂谈/论好文章和烂文章.html">
            
                    
                        <b>1.12.1.</b>
                    
                    论好文章和烂文章
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13" data-path="../测试/">
            
                <a href="../测试/">
            
                    
                        <b>1.13.</b>
                    
                    测试
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1" data-path="../测试/ginkgo/">
            
                <a href="../测试/ginkgo/">
            
                    
                        <b>1.13.1.</b>
                    
                    Ginkgo
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.1.1" data-path="../测试/ginkgo/ginkgo.html">
            
                <a href="../测试/ginkgo/ginkgo.html">
            
                    
                        <b>1.13.1.1.</b>
                    
                    Ginkgo
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.1.2" data-path="../测试/ginkgo/ginkgo_cmd.html">
            
                <a href="../测试/ginkgo/ginkgo_cmd.html">
            
                    
                        <b>1.13.1.2.</b>
                    
                    Ginkgo Cmd
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.1.3" data-path="../测试/ginkgo/readme.html">
            
                <a href="../测试/ginkgo/readme.html">
            
                    
                        <b>1.13.1.3.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.13.2" data-path="../测试/golang-test.html">
            
                <a href="../测试/golang-test.html">
            
                    
                        <b>1.13.2.</b>
                    
                    Golang Test
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.3" data-path="../测试/http测试.html">
            
                <a href="../测试/http测试.html">
            
                    
                        <b>1.13.3.</b>
                    
                    Http测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.4" data-path="../测试/readme.html">
            
                <a href="../测试/readme.html">
            
                    
                        <b>1.13.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.5" data-path="../测试/其他功能.html">
            
                <a href="../测试/其他功能.html">
            
                    
                        <b>1.13.5.</b>
                    
                    其他功能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.6" data-path="../测试/单元测试.html">
            
                <a href="../测试/单元测试.html">
            
                    
                        <b>1.13.6.</b>
                    
                    单元测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.7" data-path="../测试/单元测试2.html">
            
                <a href="../测试/单元测试2.html">
            
                    
                        <b>1.13.7.</b>
                    
                    单元测试2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.8" data-path="../测试/基准测试.html">
            
                <a href="../测试/基准测试.html">
            
                    
                        <b>1.13.8.</b>
                    
                    基准测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.9" data-path="../测试/子测试与子基准测试.html">
            
                <a href="../测试/子测试与子基准测试.html">
            
                    
                        <b>1.13.9.</b>
                    
                    子测试与子基准测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.10" data-path="../测试/并行测试.html">
            
                <a href="../测试/并行测试.html">
            
                    
                        <b>1.13.10.</b>
                    
                    并行测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.11" data-path="../测试/质量检查/">
            
                <a href="../测试/质量检查/">
            
                    
                        <b>1.13.11.</b>
                    
                    质量检查
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.13.11.1" data-path="../测试/质量检查/Sonar.html">
            
                <a href="../测试/质量检查/Sonar.html">
            
                    
                        <b>1.13.11.1.</b>
                    
                    Sonar
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.11.2" data-path="../测试/质量检查/go_lint.html">
            
                <a href="../测试/质量检查/go_lint.html">
            
                    
                        <b>1.13.11.2.</b>
                    
                    Go Lint
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.13.11.3" data-path="../测试/质量检查/readme.html">
            
                <a href="../测试/质量检查/readme.html">
            
                    
                        <b>1.13.11.3.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.14" data-path="../规范/">
            
                <a href="../规范/">
            
                    
                        <b>1.14.</b>
                    
                    规范
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.14.1" data-path="../规范/CodeReviewComments.html">
            
                <a href="../规范/CodeReviewComments.html">
            
                    
                        <b>1.14.1.</b>
                    
                    CodeReviewComments
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.2" data-path="../规范/git规范.html">
            
                <a href="../规范/git规范.html">
            
                    
                        <b>1.14.2.</b>
                    
                    Git规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.3" data-path="../规范/golang 代码规范.html">
            
                <a href="../规范/golang 代码规范.html">
            
                    
                        <b>1.14.3.</b>
                    
                    Golang 代码规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.4" data-path="../规范/readme.html">
            
                <a href="../规范/readme.html">
            
                    
                        <b>1.14.4.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.14.5" data-path="../规范/代码走读.html">
            
                <a href="../规范/代码走读.html">
            
                    
                        <b>1.14.5.</b>
                    
                    代码走读
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15" data-path="../设计模式/">
            
                <a href="../设计模式/">
            
                    
                        <b>1.15.</b>
                    
                    设计模式
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.1" data-path="../设计模式/readme.html">
            
                <a href="../设计模式/readme.html">
            
                    
                        <b>1.15.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2" data-path="../设计模式/创建模型/">
            
                <a href="../设计模式/创建模型/">
            
                    
                        <b>1.15.2.</b>
                    
                    创建模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.2.1" data-path="../设计模式/创建模型/readme.html">
            
                <a href="../设计模式/创建模型/readme.html">
            
                    
                        <b>1.15.2.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.2" data-path="../设计模式/创建模型/创建者模型.html">
            
                <a href="../设计模式/创建模型/创建者模型.html">
            
                    
                        <b>1.15.2.2.</b>
                    
                    创建者模型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.3" data-path="../设计模式/创建模型/单例模式.html">
            
                <a href="../设计模式/创建模型/单例模式.html">
            
                    
                        <b>1.15.2.3.</b>
                    
                    单例模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.4" data-path="../设计模式/创建模型/原型模式.html">
            
                <a href="../设计模式/创建模型/原型模式.html">
            
                    
                        <b>1.15.2.4.</b>
                    
                    原型模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.5" data-path="../设计模式/创建模型/工厂方法.html">
            
                <a href="../设计模式/创建模型/工厂方法.html">
            
                    
                        <b>1.15.2.5.</b>
                    
                    工厂方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.6" data-path="../设计模式/创建模型/抽象工厂.html">
            
                <a href="../设计模式/创建模型/抽象工厂.html">
            
                    
                        <b>1.15.2.6.</b>
                    
                    抽象工厂
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.2.7" data-path="../设计模式/创建模型/简单工厂.html">
            
                <a href="../设计模式/创建模型/简单工厂.html">
            
                    
                        <b>1.15.2.7.</b>
                    
                    简单工厂
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15.3" data-path="../设计模式/结构型模型/">
            
                <a href="../设计模式/结构型模型/">
            
                    
                        <b>1.15.3.</b>
                    
                    结构型模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.3.1" data-path="../设计模式/结构型模型/readme.html">
            
                <a href="../设计模式/结构型模型/readme.html">
            
                    
                        <b>1.15.3.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.2" data-path="../设计模式/结构型模型/享元模式.html">
            
                <a href="../设计模式/结构型模型/享元模式.html">
            
                    
                        <b>1.15.3.2.</b>
                    
                    享元模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.3" data-path="../设计模式/结构型模型/代理模式.html">
            
                <a href="../设计模式/结构型模型/代理模式.html">
            
                    
                        <b>1.15.3.3.</b>
                    
                    代理模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.4" data-path="../设计模式/结构型模型/外观模式.html">
            
                <a href="../设计模式/结构型模型/外观模式.html">
            
                    
                        <b>1.15.3.4.</b>
                    
                    外观模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.5" data-path="../设计模式/结构型模型/桥模式.html">
            
                <a href="../设计模式/结构型模型/桥模式.html">
            
                    
                        <b>1.15.3.5.</b>
                    
                    桥模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.6" data-path="../设计模式/结构型模型/组合模式.html">
            
                <a href="../设计模式/结构型模型/组合模式.html">
            
                    
                        <b>1.15.3.6.</b>
                    
                    组合模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.7" data-path="../设计模式/结构型模型/装饰模式.html">
            
                <a href="../设计模式/结构型模型/装饰模式.html">
            
                    
                        <b>1.15.3.7.</b>
                    
                    装饰模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.3.8" data-path="../设计模式/结构型模型/适配器模式.html">
            
                <a href="../设计模式/结构型模型/适配器模式.html">
            
                    
                        <b>1.15.3.8.</b>
                    
                    适配器模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.15.4" data-path="../设计模式/行为型模型/">
            
                <a href="../设计模式/行为型模型/">
            
                    
                        <b>1.15.4.</b>
                    
                    行为型模型
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.15.4.1" data-path="../设计模式/行为型模型/readme.html">
            
                <a href="../设计模式/行为型模型/readme.html">
            
                    
                        <b>1.15.4.1.</b>
                    
                    Readme
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.2" data-path="../设计模式/行为型模型/中介者模式.html">
            
                <a href="../设计模式/行为型模型/中介者模式.html">
            
                    
                        <b>1.15.4.2.</b>
                    
                    中介者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.3" data-path="../设计模式/行为型模型/命令模式.html">
            
                <a href="../设计模式/行为型模型/命令模式.html">
            
                    
                        <b>1.15.4.3.</b>
                    
                    命令模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.4" data-path="../设计模式/行为型模型/备忘录模式.html">
            
                <a href="../设计模式/行为型模型/备忘录模式.html">
            
                    
                        <b>1.15.4.4.</b>
                    
                    备忘录模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.5" data-path="../设计模式/行为型模型/模板方法模式.html">
            
                <a href="../设计模式/行为型模型/模板方法模式.html">
            
                    
                        <b>1.15.4.5.</b>
                    
                    模板方法模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.6" data-path="../设计模式/行为型模型/状态模式.html">
            
                <a href="../设计模式/行为型模型/状态模式.html">
            
                    
                        <b>1.15.4.6.</b>
                    
                    状态模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.7" data-path="../设计模式/行为型模型/策略模式.html">
            
                <a href="../设计模式/行为型模型/策略模式.html">
            
                    
                        <b>1.15.4.7.</b>
                    
                    策略模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.8" data-path="../设计模式/行为型模型/职责链模式.html">
            
                <a href="../设计模式/行为型模型/职责链模式.html">
            
                    
                        <b>1.15.4.8.</b>
                    
                    职责链模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.9" data-path="../设计模式/行为型模型/观察者模式.html">
            
                <a href="../设计模式/行为型模型/观察者模式.html">
            
                    
                        <b>1.15.4.9.</b>
                    
                    观察者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.10" data-path="../设计模式/行为型模型/解释器模式.html">
            
                <a href="../设计模式/行为型模型/解释器模式.html">
            
                    
                        <b>1.15.4.10.</b>
                    
                    解释器模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.11" data-path="../设计模式/行为型模型/访问者模式.html">
            
                <a href="../设计模式/行为型模型/访问者模式.html">
            
                    
                        <b>1.15.4.11.</b>
                    
                    访问者模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.15.4.12" data-path="../设计模式/行为型模型/迭代器模式.html">
            
                <a href="../设计模式/行为型模型/迭代器模式.html">
            
                    
                        <b>1.15.4.12.</b>
                    
                    迭代器模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >官方Shell</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-anchor"></i><ul><li><a href="#&#x5B98;&#x65B9;shell">&#x5B98;&#x65B9;shell</a></li></ul></div><a href="#&#x5B98;&#x65B9;shell" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="&#x5B98;&#x65B9;shell"><a name="&#x5B98;&#x65B9;shell" class="anchor-navigation-ex-anchor" href="#&#x5B98;&#x65B9;shell"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5B98;&#x65B9;shell</h1>
<pre class="language-"><code class="lang-bash"><span class="token shebang important">#!/bin/sh</span>
<span class="token builtin class-name">set</span> -e
<span class="token comment"># Docker CE for Linux installation script</span>
<span class="token comment">#</span>
<span class="token comment"># See https://docs.docker.com/install/ for the installation steps.</span>
<span class="token comment">#</span>
<span class="token comment"># This script is meant for quick &amp; easy install via:</span>
<span class="token comment">#   $ curl -fsSL https://get.docker.com -o get-docker.sh</span>
<span class="token comment">#   $ sh get-docker.sh</span>
<span class="token comment">#</span>
<span class="token comment"># For test builds (ie. release candidates):</span>
<span class="token comment">#   $ curl -fsSL https://test.docker.com -o test-docker.sh</span>
<span class="token comment">#   $ sh test-docker.sh</span>
<span class="token comment">#</span>
<span class="token comment"># NOTE: Make sure to verify the contents of the script</span>
<span class="token comment">#       you downloaded matches the contents of install.sh</span>
<span class="token comment">#       located at https://github.com/docker/docker-install</span>
<span class="token comment">#       before executing.</span>
<span class="token comment">#</span>
<span class="token comment"># Git commit from https://github.com/docker/docker-install when</span>
<span class="token comment"># the script was uploaded (Should only be modified by upload job):</span>
<span class="token assign-left variable">SCRIPT_COMMIT_SHA</span><span class="token operator">=</span><span class="token string">&quot;26ff363bcf3b3f5a00498ac43694bf1c7d9ce16c&quot;</span>


<span class="token comment"># The channel to install from:</span>
<span class="token comment">#   * nightly</span>
<span class="token comment">#   * test</span>
<span class="token comment">#   * stable</span>
<span class="token comment">#   * edge (deprecated)</span>
<span class="token assign-left variable">DEFAULT_CHANNEL_VALUE</span><span class="token operator">=</span><span class="token string">&quot;test&quot;</span>
<span class="token keyword">if</span> <span class="token punctuation">[</span> -z <span class="token string">&quot;<span class="token variable">$CHANNEL</span>&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
    <span class="token assign-left variable">CHANNEL</span><span class="token operator">=</span><span class="token variable">$DEFAULT_CHANNEL_VALUE</span>
<span class="token keyword">fi</span>

<span class="token assign-left variable">DEFAULT_DOWNLOAD_URL</span><span class="token operator">=</span><span class="token string">&quot;https://download.docker.com&quot;</span>
<span class="token keyword">if</span> <span class="token punctuation">[</span> -z <span class="token string">&quot;<span class="token variable">$DOWNLOAD_URL</span>&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
    <span class="token assign-left variable">DOWNLOAD_URL</span><span class="token operator">=</span><span class="token variable">$DEFAULT_DOWNLOAD_URL</span>
<span class="token keyword">fi</span>

<span class="token assign-left variable">DEFAULT_REPO_FILE</span><span class="token operator">=</span><span class="token string">&quot;docker-ce.repo&quot;</span>
<span class="token keyword">if</span> <span class="token punctuation">[</span> -z <span class="token string">&quot;<span class="token variable">$REPO_FILE</span>&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
    <span class="token assign-left variable">REPO_FILE</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable">$DEFAULT_REPO_FILE</span>&quot;</span>
<span class="token keyword">fi</span>

<span class="token assign-left variable">mirror</span><span class="token operator">=</span><span class="token string">&apos;&apos;</span>
<span class="token assign-left variable">DRY_RUN</span><span class="token operator">=</span><span class="token variable">${DRY_RUN<span class="token operator">:-</span>}</span>
<span class="token keyword">while</span> <span class="token punctuation">[</span> <span class="token variable">$#</span> -gt <span class="token number">0</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">do</span>
    <span class="token keyword">case</span> <span class="token string">&quot;<span class="token variable">$1</span>&quot;</span> <span class="token keyword">in</span>
        --mirror<span class="token punctuation">)</span>
            <span class="token assign-left variable">mirror</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable">$2</span>&quot;</span>
            <span class="token builtin class-name">shift</span>
            <span class="token punctuation">;</span><span class="token punctuation">;</span>
        --dry-run<span class="token punctuation">)</span>
            <span class="token assign-left variable">DRY_RUN</span><span class="token operator">=</span><span class="token number">1</span>
            <span class="token punctuation">;</span><span class="token punctuation">;</span>
        --*<span class="token punctuation">)</span>
            <span class="token builtin class-name">echo</span> <span class="token string">&quot;Illegal option <span class="token variable">$1</span>&quot;</span>
            <span class="token punctuation">;</span><span class="token punctuation">;</span>
    <span class="token keyword">esac</span>
    <span class="token builtin class-name">shift</span> <span class="token variable"><span class="token variable">$((</span> $# <span class="token operator">&gt;</span> <span class="token number">0</span> <span class="token operator">?</span> <span class="token number">1</span> <span class="token operator">:</span> <span class="token number">0</span> <span class="token variable">))</span></span>
<span class="token keyword">done</span>

<span class="token keyword">case</span> <span class="token string">&quot;<span class="token variable">$mirror</span>&quot;</span> <span class="token keyword">in</span>
    Aliyun<span class="token punctuation">)</span>
        <span class="token assign-left variable">DOWNLOAD_URL</span><span class="token operator">=</span><span class="token string">&quot;https://mirrors.aliyun.com/docker-ce&quot;</span>
        <span class="token punctuation">;</span><span class="token punctuation">;</span>
    AzureChinaCloud<span class="token punctuation">)</span>
        <span class="token assign-left variable">DOWNLOAD_URL</span><span class="token operator">=</span><span class="token string">&quot;https://mirror.azure.cn/docker-ce&quot;</span>
        <span class="token punctuation">;</span><span class="token punctuation">;</span>
<span class="token keyword">esac</span>

<span class="token function-name function">command_exists</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token builtin class-name">command</span> -v <span class="token string">&quot;<span class="token variable">$@</span>&quot;</span> <span class="token operator">&gt;</span> /dev/null <span class="token operator"><span class="token file-descriptor important">2</span>&gt;</span><span class="token file-descriptor important">&amp;1</span>
<span class="token punctuation">}</span>

<span class="token function-name function">is_dry_run</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">if</span> <span class="token punctuation">[</span> -z <span class="token string">&quot;<span class="token variable">$DRY_RUN</span>&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
        <span class="token builtin class-name">return</span> <span class="token number">1</span>
    <span class="token keyword">else</span>
        <span class="token builtin class-name">return</span> <span class="token number">0</span>
    <span class="token keyword">fi</span>
<span class="token punctuation">}</span>

<span class="token function-name function">is_wsl</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">case</span> <span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span><span class="token function">uname</span> -r<span class="token variable">)</span></span>&quot;</span> <span class="token keyword">in</span>
    *microsoft* <span class="token punctuation">)</span> <span class="token boolean">true</span> <span class="token punctuation">;</span><span class="token punctuation">;</span> <span class="token comment"># WSL 2</span>
    *Microsoft* <span class="token punctuation">)</span> <span class="token boolean">true</span> <span class="token punctuation">;</span><span class="token punctuation">;</span> <span class="token comment"># WSL 1</span>
    * <span class="token punctuation">)</span> <span class="token boolean">false</span><span class="token punctuation">;</span><span class="token punctuation">;</span>
    <span class="token keyword">esac</span>
<span class="token punctuation">}</span>

<span class="token function-name function">is_darwin</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">case</span> <span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span><span class="token function">uname</span> -s<span class="token variable">)</span></span>&quot;</span> <span class="token keyword">in</span>
    *darwin* <span class="token punctuation">)</span> <span class="token boolean">true</span> <span class="token punctuation">;</span><span class="token punctuation">;</span>
    *Darwin* <span class="token punctuation">)</span> <span class="token boolean">true</span> <span class="token punctuation">;</span><span class="token punctuation">;</span>
    * <span class="token punctuation">)</span> <span class="token boolean">false</span><span class="token punctuation">;</span><span class="token punctuation">;</span>
    <span class="token keyword">esac</span>
<span class="token punctuation">}</span>

<span class="token function-name function">deprecation_notice</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token assign-left variable">distro</span><span class="token operator">=</span><span class="token variable">$1</span>
    <span class="token assign-left variable">date</span><span class="token operator">=</span><span class="token variable">$2</span>
    <span class="token builtin class-name">echo</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;DEPRECATION WARNING:&quot;</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;    The distribution, <span class="token variable">$distro</span>, will no longer be supported in this script as of <span class="token variable">$date</span>.&quot;</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;    If you feel this is a mistake please submit an issue at https://github.com/docker/docker-install/issues/new&quot;</span>
    <span class="token builtin class-name">echo</span>
    <span class="token function">sleep</span> <span class="token number">10</span>
<span class="token punctuation">}</span>

<span class="token function-name function">get_distribution</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token assign-left variable">lsb_dist</span><span class="token operator">=</span><span class="token string">&quot;&quot;</span>
    <span class="token comment"># Every system that we officially support has /etc/os-release</span>
    <span class="token keyword">if</span> <span class="token punctuation">[</span> -r /etc/os-release <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
        <span class="token assign-left variable">lsb_dist</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span><span class="token builtin class-name">.</span> /etc/os-release <span class="token operator">&amp;&amp;</span> <span class="token builtin class-name">echo</span> <span class="token string">&quot;<span class="token variable">$ID</span>&quot;</span><span class="token variable">)</span></span>&quot;</span>
    <span class="token keyword">fi</span>
    <span class="token comment"># Returning an empty string here should be alright since the</span>
    <span class="token comment"># case statements don&apos;t act unless you provide an actual value</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;<span class="token variable">$lsb_dist</span>&quot;</span>
<span class="token punctuation">}</span>

<span class="token function-name function">add_debian_backport_repo</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token assign-left variable">debian_version</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable">$1</span>&quot;</span>
    <span class="token assign-left variable">backports</span><span class="token operator">=</span><span class="token string">&quot;deb http://ftp.debian.org/debian <span class="token variable">$debian_version</span>-backports main&quot;</span>
    <span class="token keyword">if</span> <span class="token operator">!</span> <span class="token function">grep</span> -Fxq <span class="token string">&quot;<span class="token variable">$backports</span>&quot;</span> /etc/apt/sources.list<span class="token punctuation">;</span> <span class="token keyword">then</span>
        <span class="token punctuation">(</span>set -x<span class="token punctuation">;</span> <span class="token variable">$sh_c</span> <span class="token string">&quot;echo <span class="token entity" title="\&quot;">\&quot;</span><span class="token variable">$backports</span><span class="token entity" title="\&quot;">\&quot;</span> &gt;&gt; /etc/apt/sources.list&quot;</span><span class="token punctuation">)</span>
    <span class="token keyword">fi</span>
<span class="token punctuation">}</span>

<span class="token function-name function">echo_docker_as_nonroot</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token keyword">if</span> is_dry_run<span class="token punctuation">;</span> <span class="token keyword">then</span>
        <span class="token builtin class-name">return</span>
    <span class="token keyword">fi</span>
    <span class="token keyword">if</span> command_exists docker <span class="token operator">&amp;&amp;</span> <span class="token punctuation">[</span> -e /var/run/docker.sock <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
        <span class="token punctuation">(</span>
            <span class="token builtin class-name">set</span> -x
            <span class="token variable">$sh_c</span> <span class="token string">&apos;docker version&apos;</span>
        <span class="token punctuation">)</span> <span class="token operator">||</span> <span class="token boolean">true</span>
    <span class="token keyword">fi</span>
    <span class="token assign-left variable">your_user</span><span class="token operator">=</span>your-user
    <span class="token punctuation">[</span> <span class="token string">&quot;<span class="token variable">$user</span>&quot;</span> <span class="token operator">!=</span> <span class="token string">&apos;root&apos;</span> <span class="token punctuation">]</span> <span class="token operator">&amp;&amp;</span> <span class="token assign-left variable">your_user</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable">$user</span>&quot;</span>
    <span class="token comment"># intentionally mixed spaces and tabs here -- tabs are stripped by &quot;&lt;&lt;-EOF&quot;, spaces are kept in the output</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;If you would like to use Docker as a non-root user, you should now consider&quot;</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;adding your user to the <span class="token entity" title="\&quot;">\&quot;</span>docker<span class="token entity" title="\&quot;">\&quot;</span> group with something like:&quot;</span>
    <span class="token builtin class-name">echo</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;  sudo usermod -aG docker <span class="token variable">$your_user</span>&quot;</span>
    <span class="token builtin class-name">echo</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;Remember that you will have to log out and back in for this to take effect!&quot;</span>
    <span class="token builtin class-name">echo</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;WARNING: Adding a user to the <span class="token entity" title="\&quot;">\&quot;</span>docker<span class="token entity" title="\&quot;">\&quot;</span> group will grant the ability to run&quot;</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;         containers which can be used to obtain root privileges on the&quot;</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;         docker host.&quot;</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;         Refer to https://docs.docker.com/engine/security/security/#docker-daemon-attack-surface&quot;</span>
    <span class="token builtin class-name">echo</span> <span class="token string">&quot;         for more information.&quot;</span>

<span class="token punctuation">}</span>

<span class="token comment"># Check if this is a forked Linux distro</span>
<span class="token function-name function">check_forked</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>

    <span class="token comment"># Check for lsb_release command existence, it usually exists in forked distros</span>
    <span class="token keyword">if</span> command_exists lsb_release<span class="token punctuation">;</span> <span class="token keyword">then</span>
        <span class="token comment"># Check if the `-u` option is supported</span>
        <span class="token builtin class-name">set</span> +e
        lsb_release -a -u <span class="token operator">&gt;</span> /dev/null <span class="token operator"><span class="token file-descriptor important">2</span>&gt;</span><span class="token file-descriptor important">&amp;1</span>
        <span class="token assign-left variable">lsb_release_exit_code</span><span class="token operator">=</span><span class="token variable">$?</span>
        <span class="token builtin class-name">set</span> -e

        <span class="token comment"># Check if the command has exited successfully, it means we&apos;re in a forked distro</span>
        <span class="token keyword">if</span> <span class="token punctuation">[</span> <span class="token string">&quot;<span class="token variable">$lsb_release_exit_code</span>&quot;</span> <span class="token operator">=</span> <span class="token string">&quot;0&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
            <span class="token comment"># Print info about current distro</span>
            <span class="token function">cat</span> <span class="token operator">&lt;&lt;-</span>EOF
            You<span class="token string">&apos;re using &apos;</span><span class="token variable">$lsb_dist</span><span class="token string">&apos; version &apos;</span><span class="token variable">$dist_version</span><span class="token string">&apos;.
            EOF

            # Get the upstream release info
            lsb_dist=<span class="token variable"><span class="token variable">$(</span>lsb_release -a -u <span class="token operator"><span class="token file-descriptor important">2</span>&gt;</span><span class="token file-descriptor important">&amp;1</span> <span class="token operator">|</span> <span class="token function">tr</span> <span class="token string">&apos;[:upper:]&apos;</span> <span class="token string">&apos;[:lower:]&apos;</span> <span class="token operator">|</span> <span class="token function">grep</span> -E <span class="token string">&apos;id&apos;</span> <span class="token operator">|</span> <span class="token function">cut</span> -d <span class="token string">&apos;:&apos;</span> -f <span class="token number">2</span> <span class="token operator">|</span> <span class="token function">tr</span> -d <span class="token string">&apos;[:space:]&apos;</span><span class="token variable">)</span></span>
            dist_version=<span class="token variable"><span class="token variable">$(</span>lsb_release -a -u <span class="token operator"><span class="token file-descriptor important">2</span>&gt;</span><span class="token file-descriptor important">&amp;1</span> <span class="token operator">|</span> <span class="token function">tr</span> <span class="token string">&apos;[:upper:]&apos;</span> <span class="token string">&apos;[:lower:]&apos;</span> <span class="token operator">|</span> <span class="token function">grep</span> -E <span class="token string">&apos;codename&apos;</span> <span class="token operator">|</span> <span class="token function">cut</span> -d <span class="token string">&apos;:&apos;</span> -f <span class="token number">2</span> <span class="token operator">|</span> <span class="token function">tr</span> -d <span class="token string">&apos;[:space:]&apos;</span><span class="token variable">)</span></span>

            # Print info about upstream distro
            cat &lt;&lt;-EOF
            Upstream release is &apos;</span><span class="token variable">$lsb_dist</span><span class="token string">&apos; version &apos;</span><span class="token variable">$dist_version</span><span class="token string">&apos;.
            EOF
        else
            if [ -r /etc/debian_version ] &amp;&amp; [ &quot;<span class="token variable">$lsb_dist</span>&quot; != &quot;ubuntu&quot; ] &amp;&amp; [ &quot;<span class="token variable">$lsb_dist</span>&quot; != &quot;raspbian&quot; ]; then
                if [ &quot;<span class="token variable">$lsb_dist</span>&quot; = &quot;osmc&quot; ]; then
                    # OSMC runs Raspbian
                    lsb_dist=raspbian
                else
                    # We&apos;</span>re Debian and don<span class="token string">&apos;t even know it!
                    lsb_dist=debian
                fi
                dist_version=&quot;<span class="token variable"><span class="token variable">$(</span><span class="token function">sed</span> <span class="token string">&apos;s/\/.*//&apos;</span> /etc/debian_version <span class="token operator">|</span> <span class="token function">sed</span> <span class="token string">&apos;s/\..*//&apos;</span><span class="token variable">)</span></span>&quot;
                case &quot;<span class="token variable">$dist_version</span>&quot; in
                    10)
                        dist_version=&quot;buster&quot;
                    ;;
                    9)
                        dist_version=&quot;stretch&quot;
                    ;;
                    8|&apos;</span>Kali Linux <span class="token number">2</span><span class="token string">&apos;)
                        dist_version=&quot;jessie&quot;
                    ;;
                esac
            fi
        fi
    fi
}

semverParse() {
    major=&quot;<span class="token variable">${1<span class="token operator">%%</span>.*}</span>&quot;
    minor=&quot;<span class="token variable">${1<span class="token operator">#</span>$major.}</span>&quot;
    minor=&quot;<span class="token variable">${minor<span class="token operator">%%</span>.*}</span>&quot;
    patch=&quot;<span class="token variable">${1<span class="token operator">#</span>$major.$minor.}</span>&quot;
    patch=&quot;<span class="token variable">${patch<span class="token operator">%%</span><span class="token punctuation">[</span>-.<span class="token punctuation">]</span>*}</span>&quot;
}

do_install() {
    echo &quot;# Executing docker install script, commit: <span class="token variable">$SCRIPT_COMMIT_SHA</span>&quot;

    if command_exists docker; then
        docker_version=&quot;<span class="token variable"><span class="token variable">$(</span>docker -v <span class="token operator">|</span> <span class="token function">cut</span> -d <span class="token string">&apos; &apos;</span> -f3 <span class="token operator">|</span> <span class="token function">cut</span> -d <span class="token string">&apos;,&apos;</span> -f1<span class="token variable">)</span></span>&quot;
        MAJOR_W=1
        MINOR_W=10

        semverParse &quot;<span class="token variable">$docker_version</span>&quot;

        shouldWarn=0
        if [ &quot;<span class="token variable">$major</span>&quot; -lt &quot;<span class="token variable">$MAJOR_W</span>&quot; ]; then
            shouldWarn=1
        fi

        if [ &quot;<span class="token variable">$major</span>&quot; -le &quot;<span class="token variable">$MAJOR_W</span>&quot; ] &amp;&amp; [ &quot;<span class="token variable">$minor</span>&quot; -lt &quot;<span class="token variable">$MINOR_W</span>&quot; ]; then
            shouldWarn=1
        fi

        cat &gt;&amp;2 &lt;&lt;-&apos;</span>EOF<span class="token string">&apos;
            Warning: the &quot;docker&quot; command appears to already exist on this system.

            If you already have Docker installed, this script can cause trouble, which is
            why we&apos;</span>re displaying this warning and provide the opportunity to cancel the
            installation.

            If you installed the current Docker package using this script and are using it
        EOF

        <span class="token keyword">if</span> <span class="token punctuation">[</span> <span class="token variable">$shouldWarn</span> -eq <span class="token number">1</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
            <span class="token function">cat</span> <span class="token operator">&gt;</span><span class="token file-descriptor important">&amp;2</span> <span class="token operator">&lt;&lt;-</span><span class="token string">&apos;EOF&apos;</span>
            again to update Docker, we urge you to migrate your image store before upgrading
            to v1.10+.

            You can <span class="token function">find</span> instructions <span class="token keyword">for</span> this here:
            https://github.com/docker/docker/wiki/Engine-v1.10.0-content-addressability-migration
            EOF
        <span class="token keyword">else</span>
            <span class="token function">cat</span> <span class="token operator">&gt;</span><span class="token file-descriptor important">&amp;2</span> <span class="token operator">&lt;&lt;-</span><span class="token string">&apos;EOF&apos;</span>
            again to update Docker, you can safely ignore this message.
            EOF
        <span class="token keyword">fi</span>

        <span class="token function">cat</span> <span class="token operator">&gt;</span><span class="token file-descriptor important">&amp;2</span> <span class="token operator">&lt;&lt;-</span><span class="token string">&apos;EOF&apos;</span>

            You may press Ctrl+C now to abort this script.
        EOF
        <span class="token punctuation">(</span> <span class="token builtin class-name">set</span> -x<span class="token punctuation">;</span> <span class="token function">sleep</span> <span class="token number">20</span> <span class="token punctuation">)</span>
    <span class="token keyword">fi</span>

    <span class="token assign-left variable">user</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span><span class="token function">id</span> -un <span class="token operator"><span class="token file-descriptor important">2</span>&gt;</span>/dev/null <span class="token operator">||</span> <span class="token boolean">true</span><span class="token variable">)</span></span>&quot;</span>

    <span class="token assign-left variable">sh_c</span><span class="token operator">=</span><span class="token string">&apos;sh -c&apos;</span>
    <span class="token keyword">if</span> <span class="token punctuation">[</span> <span class="token string">&quot;<span class="token variable">$user</span>&quot;</span> <span class="token operator">!=</span> <span class="token string">&apos;root&apos;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
        <span class="token keyword">if</span> command_exists <span class="token function">sudo</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
            <span class="token assign-left variable">sh_c</span><span class="token operator">=</span><span class="token string">&apos;sudo -E sh -c&apos;</span>
        <span class="token keyword">elif</span> command_exists <span class="token function">su</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
            <span class="token assign-left variable">sh_c</span><span class="token operator">=</span><span class="token string">&apos;su -c&apos;</span>
        <span class="token keyword">else</span>
            <span class="token function">cat</span> <span class="token operator">&gt;</span><span class="token file-descriptor important">&amp;2</span> <span class="token operator">&lt;&lt;-</span><span class="token string">&apos;EOF&apos;</span>
            Error: this installer needs the ability to run commands as root.
            We are unable to <span class="token function">find</span> either <span class="token string">&quot;sudo&quot;</span> or <span class="token string">&quot;su&quot;</span> available to <span class="token function">make</span> this happen.
            EOF
            <span class="token builtin class-name">exit</span> <span class="token number">1</span>
        <span class="token keyword">fi</span>
    <span class="token keyword">fi</span>

    <span class="token keyword">if</span> is_dry_run<span class="token punctuation">;</span> <span class="token keyword">then</span>
        <span class="token assign-left variable">sh_c</span><span class="token operator">=</span><span class="token string">&quot;echo&quot;</span>
    <span class="token keyword">fi</span>

    <span class="token comment"># perform some very rudimentary platform detection</span>
    <span class="token assign-left variable">lsb_dist</span><span class="token operator">=</span><span class="token variable"><span class="token variable">$(</span> get_distribution <span class="token variable">)</span></span>
    <span class="token assign-left variable">lsb_dist</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span><span class="token builtin class-name">echo</span> <span class="token string">&quot;<span class="token variable">$lsb_dist</span>&quot;</span> <span class="token operator">|</span> <span class="token function">tr</span> <span class="token string">&apos;[:upper:]&apos;</span> <span class="token string">&apos;[:lower:]&apos;</span><span class="token variable">)</span></span>&quot;</span>

    <span class="token keyword">if</span> is_wsl<span class="token punctuation">;</span> <span class="token keyword">then</span>
        <span class="token builtin class-name">echo</span>
        <span class="token builtin class-name">echo</span> <span class="token string">&quot;WSL DETECTED: We recommend using Docker Desktop for Windows.&quot;</span>
        <span class="token builtin class-name">echo</span> <span class="token string">&quot;Please get Docker Desktop from https://www.docker.com/products/docker-desktop&quot;</span>
        <span class="token builtin class-name">echo</span>
        <span class="token function">cat</span> <span class="token operator">&gt;</span><span class="token file-descriptor important">&amp;2</span> <span class="token operator">&lt;&lt;-</span><span class="token string">&apos;EOF&apos;</span>

            You may press Ctrl+C now to abort this script.
        EOF
        <span class="token punctuation">(</span> <span class="token builtin class-name">set</span> -x<span class="token punctuation">;</span> <span class="token function">sleep</span> <span class="token number">20</span> <span class="token punctuation">)</span>
    <span class="token keyword">fi</span>

    <span class="token keyword">case</span> <span class="token string">&quot;<span class="token variable">$lsb_dist</span>&quot;</span> <span class="token keyword">in</span>

        ubuntu<span class="token punctuation">)</span>
            <span class="token keyword">if</span> command_exists lsb_release<span class="token punctuation">;</span> <span class="token keyword">then</span>
                <span class="token assign-left variable">dist_version</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span>lsb_release --codename <span class="token operator">|</span> <span class="token function">cut</span> -f2<span class="token variable">)</span></span>&quot;</span>
            <span class="token keyword">fi</span>
            <span class="token keyword">if</span> <span class="token punctuation">[</span> -z <span class="token string">&quot;<span class="token variable">$dist_version</span>&quot;</span> <span class="token punctuation">]</span> <span class="token operator">&amp;&amp;</span> <span class="token punctuation">[</span> -r /etc/lsb-release <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
                <span class="token assign-left variable">dist_version</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span><span class="token builtin class-name">.</span> /etc/lsb-release <span class="token operator">&amp;&amp;</span> <span class="token builtin class-name">echo</span> <span class="token string">&quot;<span class="token variable">$DISTRIB_CODENAME</span>&quot;</span><span class="token variable">)</span></span>&quot;</span>
            <span class="token keyword">fi</span>
        <span class="token punctuation">;</span><span class="token punctuation">;</span>

        debian<span class="token operator">|</span>raspbian<span class="token punctuation">)</span>
            <span class="token assign-left variable">dist_version</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span><span class="token function">sed</span> <span class="token string">&apos;s/\/.*//&apos;</span> /etc/debian_version <span class="token operator">|</span> <span class="token function">sed</span> <span class="token string">&apos;s/\..*//&apos;</span><span class="token variable">)</span></span>&quot;</span>
            <span class="token keyword">case</span> <span class="token string">&quot;<span class="token variable">$dist_version</span>&quot;</span> <span class="token keyword">in</span>
                <span class="token number">10</span><span class="token punctuation">)</span>
                    <span class="token assign-left variable">dist_version</span><span class="token operator">=</span><span class="token string">&quot;buster&quot;</span>
                <span class="token punctuation">;</span><span class="token punctuation">;</span>
                <span class="token number">9</span><span class="token punctuation">)</span>
                    <span class="token assign-left variable">dist_version</span><span class="token operator">=</span><span class="token string">&quot;stretch&quot;</span>
                <span class="token punctuation">;</span><span class="token punctuation">;</span>
                <span class="token number">8</span><span class="token punctuation">)</span>
                    <span class="token assign-left variable">dist_version</span><span class="token operator">=</span><span class="token string">&quot;jessie&quot;</span>
                <span class="token punctuation">;</span><span class="token punctuation">;</span>
            <span class="token keyword">esac</span>
        <span class="token punctuation">;</span><span class="token punctuation">;</span>

        centos<span class="token operator">|</span>rhel<span class="token punctuation">)</span>
            <span class="token keyword">if</span> <span class="token punctuation">[</span> -z <span class="token string">&quot;<span class="token variable">$dist_version</span>&quot;</span> <span class="token punctuation">]</span> <span class="token operator">&amp;&amp;</span> <span class="token punctuation">[</span> -r /etc/os-release <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
                <span class="token assign-left variable">dist_version</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span><span class="token builtin class-name">.</span> /etc/os-release <span class="token operator">&amp;&amp;</span> <span class="token builtin class-name">echo</span> <span class="token string">&quot;<span class="token variable">$VERSION_ID</span>&quot;</span><span class="token variable">)</span></span>&quot;</span>
            <span class="token keyword">fi</span>
        <span class="token punctuation">;</span><span class="token punctuation">;</span>

        *<span class="token punctuation">)</span>
            <span class="token keyword">if</span> command_exists lsb_release<span class="token punctuation">;</span> <span class="token keyword">then</span>
                <span class="token assign-left variable">dist_version</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span>lsb_release --release <span class="token operator">|</span> <span class="token function">cut</span> -f2<span class="token variable">)</span></span>&quot;</span>
            <span class="token keyword">fi</span>
            <span class="token keyword">if</span> <span class="token punctuation">[</span> -z <span class="token string">&quot;<span class="token variable">$dist_version</span>&quot;</span> <span class="token punctuation">]</span> <span class="token operator">&amp;&amp;</span> <span class="token punctuation">[</span> -r /etc/os-release <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
                <span class="token assign-left variable">dist_version</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span><span class="token builtin class-name">.</span> /etc/os-release <span class="token operator">&amp;&amp;</span> <span class="token builtin class-name">echo</span> <span class="token string">&quot;<span class="token variable">$VERSION_ID</span>&quot;</span><span class="token variable">)</span></span>&quot;</span>
            <span class="token keyword">fi</span>
        <span class="token punctuation">;</span><span class="token punctuation">;</span>

    <span class="token keyword">esac</span>

    <span class="token comment"># Check if this is a forked Linux distro</span>
    check_forked

    <span class="token comment"># Run setup for each distro accordingly</span>
    <span class="token keyword">case</span> <span class="token string">&quot;<span class="token variable">$lsb_dist</span>&quot;</span> <span class="token keyword">in</span>
        ubuntu<span class="token operator">|</span>debian<span class="token operator">|</span>raspbian<span class="token punctuation">)</span>
            <span class="token assign-left variable">pre_reqs</span><span class="token operator">=</span><span class="token string">&quot;apt-transport-https ca-certificates curl&quot;</span>
            <span class="token keyword">if</span> <span class="token punctuation">[</span> <span class="token string">&quot;<span class="token variable">$lsb_dist</span>&quot;</span> <span class="token operator">=</span> <span class="token string">&quot;debian&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
                <span class="token comment"># libseccomp2 does not exist for debian jessie main repos for aarch64</span>
                <span class="token keyword">if</span> <span class="token punctuation">[</span> <span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span><span class="token function">uname</span> -m<span class="token variable">)</span></span>&quot;</span> <span class="token operator">=</span> <span class="token string">&quot;aarch64&quot;</span> <span class="token punctuation">]</span> <span class="token operator">&amp;&amp;</span> <span class="token punctuation">[</span> <span class="token string">&quot;<span class="token variable">$dist_version</span>&quot;</span> <span class="token operator">=</span> <span class="token string">&quot;jessie&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
                    add_debian_backport_repo <span class="token string">&quot;<span class="token variable">$dist_version</span>&quot;</span>
                <span class="token keyword">fi</span>
            <span class="token keyword">fi</span>

            <span class="token keyword">if</span> <span class="token operator">!</span> <span class="token builtin class-name">command</span> -v gpg <span class="token operator">&gt;</span> /dev/null<span class="token punctuation">;</span> <span class="token keyword">then</span>
                <span class="token assign-left variable">pre_reqs</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable">$pre_reqs</span> gnupg&quot;</span>
            <span class="token keyword">fi</span>
            <span class="token assign-left variable">apt_repo</span><span class="token operator">=</span><span class="token string">&quot;deb [arch=<span class="token variable"><span class="token variable">$(</span>dpkg --print-architecture<span class="token variable">)</span></span>] <span class="token variable">$DOWNLOAD_URL</span>/linux/<span class="token variable">$lsb_dist</span> <span class="token variable">$dist_version</span> <span class="token variable">$CHANNEL</span>&quot;</span>
            <span class="token punctuation">(</span>
                <span class="token keyword">if</span> <span class="token operator">!</span> is_dry_run<span class="token punctuation">;</span> <span class="token keyword">then</span>
                    <span class="token builtin class-name">set</span> -x
                <span class="token keyword">fi</span>
                <span class="token variable">$sh_c</span> <span class="token string">&apos;apt-get update -qq &gt;/dev/null&apos;</span>
                <span class="token variable">$sh_c</span> <span class="token string">&quot;DEBIAN_FRONTEND=noninteractive apt-get install -y -qq <span class="token variable">$pre_reqs</span> &gt;/dev/null&quot;</span>
                <span class="token variable">$sh_c</span> <span class="token string">&quot;curl -fsSL <span class="token entity" title="\&quot;">\&quot;</span><span class="token variable">$DOWNLOAD_URL</span>/linux/<span class="token variable">$lsb_dist</span>/gpg<span class="token entity" title="\&quot;">\&quot;</span> | apt-key add -qq - &gt;/dev/null&quot;</span>
                <span class="token variable">$sh_c</span> <span class="token string">&quot;echo <span class="token entity" title="\&quot;">\&quot;</span><span class="token variable">$apt_repo</span><span class="token entity" title="\&quot;">\&quot;</span> &gt; /etc/apt/sources.list.d/docker.list&quot;</span>
                <span class="token variable">$sh_c</span> <span class="token string">&apos;apt-get update -qq &gt;/dev/null&apos;</span>
            <span class="token punctuation">)</span>
            <span class="token assign-left variable">pkg_version</span><span class="token operator">=</span><span class="token string">&quot;&quot;</span>
            <span class="token keyword">if</span> <span class="token punctuation">[</span> -n <span class="token string">&quot;<span class="token variable">$VERSION</span>&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
                <span class="token keyword">if</span> is_dry_run<span class="token punctuation">;</span> <span class="token keyword">then</span>
                    <span class="token builtin class-name">echo</span> <span class="token string">&quot;# WARNING: VERSION pinning is not supported in DRY_RUN&quot;</span>
                <span class="token keyword">else</span>
                    <span class="token comment"># Will work for incomplete versions IE (17.12), but may not actually grab the &quot;latest&quot; if in the test channel</span>
                    <span class="token assign-left variable">pkg_pattern</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span><span class="token builtin class-name">echo</span> <span class="token string">&quot;<span class="token variable">$VERSION</span>&quot;</span> <span class="token operator">|</span> <span class="token function">sed</span> <span class="token string">&quot;s/-ce-/~ce~.*/g&quot;</span> <span class="token operator">|</span> <span class="token function">sed</span> <span class="token string">&quot;s/-/.*/g&quot;</span><span class="token variable">)</span></span>.*-0~<span class="token variable">$lsb_dist</span>&quot;</span>
                    <span class="token assign-left variable">search_command</span><span class="token operator">=</span><span class="token string">&quot;apt-cache madison &apos;docker-ce&apos; | grep &apos;<span class="token variable">$pkg_pattern</span>&apos; | head -1 | awk &apos;{\<span class="token variable">$1</span>=\<span class="token variable">$1</span>};1&apos; | cut -d&apos; &apos; -f 3&quot;</span>
                    <span class="token assign-left variable">pkg_version</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span>$sh_c <span class="token string">&quot;<span class="token variable">$search_command</span>&quot;</span><span class="token variable">)</span></span>&quot;</span>
                    <span class="token builtin class-name">echo</span> <span class="token string">&quot;INFO: Searching repository for VERSION &apos;<span class="token variable">$VERSION</span>&apos;&quot;</span>
                    <span class="token builtin class-name">echo</span> <span class="token string">&quot;INFO: <span class="token variable">$search_command</span>&quot;</span>
                    <span class="token keyword">if</span> <span class="token punctuation">[</span> -z <span class="token string">&quot;<span class="token variable">$pkg_version</span>&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
                        <span class="token builtin class-name">echo</span>
                        <span class="token builtin class-name">echo</span> <span class="token string">&quot;ERROR: &apos;<span class="token variable">$VERSION</span>&apos; not found amongst apt-cache madison results&quot;</span>
                        <span class="token builtin class-name">echo</span>
                        <span class="token builtin class-name">exit</span> <span class="token number">1</span>
                    <span class="token keyword">fi</span>
                    <span class="token assign-left variable">search_command</span><span class="token operator">=</span><span class="token string">&quot;apt-cache madison &apos;docker-ce-cli&apos; | grep &apos;<span class="token variable">$pkg_pattern</span>&apos; | head -1 | awk &apos;{\<span class="token variable">$1</span>=\<span class="token variable">$1</span>};1&apos; | cut -d&apos; &apos; -f 3&quot;</span>
                    <span class="token comment"># Don&apos;t insert an = for cli_pkg_version, we&apos;ll just include it later</span>
                    <span class="token assign-left variable">cli_pkg_version</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span>$sh_c <span class="token string">&quot;<span class="token variable">$search_command</span>&quot;</span><span class="token variable">)</span></span>&quot;</span>
                    <span class="token assign-left variable">pkg_version</span><span class="token operator">=</span><span class="token string">&quot;=<span class="token variable">$pkg_version</span>&quot;</span>
                <span class="token keyword">fi</span>
            <span class="token keyword">fi</span>
            <span class="token punctuation">(</span>
                <span class="token keyword">if</span> <span class="token operator">!</span> is_dry_run<span class="token punctuation">;</span> <span class="token keyword">then</span>
                    <span class="token builtin class-name">set</span> -x
                <span class="token keyword">fi</span>
                <span class="token keyword">if</span> <span class="token punctuation">[</span> -n <span class="token string">&quot;<span class="token variable">$cli_pkg_version</span>&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
                    <span class="token variable">$sh_c</span> <span class="token string">&quot;apt-get install -y -qq --no-install-recommends docker-ce-cli=<span class="token variable">$cli_pkg_version</span> &gt;/dev/null&quot;</span>
                <span class="token keyword">fi</span>
                <span class="token variable">$sh_c</span> <span class="token string">&quot;apt-get install -y -qq --no-install-recommends docker-ce<span class="token variable">$pkg_version</span> &gt;/dev/null&quot;</span>
            <span class="token punctuation">)</span>
            echo_docker_as_nonroot
            <span class="token builtin class-name">exit</span> <span class="token number">0</span>
            <span class="token punctuation">;</span><span class="token punctuation">;</span>
        centos<span class="token operator">|</span>fedora<span class="token operator">|</span>rhel<span class="token punctuation">)</span>
            <span class="token assign-left variable">yum_repo</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable">$DOWNLOAD_URL</span>/linux/<span class="token variable">$lsb_dist</span>/<span class="token variable">$REPO_FILE</span>&quot;</span>
            <span class="token keyword">if</span> <span class="token operator">!</span> <span class="token function">curl</span> -Ifs <span class="token string">&quot;<span class="token variable">$yum_repo</span>&quot;</span> <span class="token operator">&gt;</span> /dev/null<span class="token punctuation">;</span> <span class="token keyword">then</span>
                <span class="token builtin class-name">echo</span> <span class="token string">&quot;Error: Unable to curl repository file <span class="token variable">$yum_repo</span>, is it valid?&quot;</span>
                <span class="token builtin class-name">exit</span> <span class="token number">1</span>
            <span class="token keyword">fi</span>
            <span class="token keyword">if</span> <span class="token punctuation">[</span> <span class="token string">&quot;<span class="token variable">$lsb_dist</span>&quot;</span> <span class="token operator">=</span> <span class="token string">&quot;fedora&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
                <span class="token assign-left variable">pkg_manager</span><span class="token operator">=</span><span class="token string">&quot;dnf&quot;</span>
                <span class="token assign-left variable">config_manager</span><span class="token operator">=</span><span class="token string">&quot;dnf config-manager&quot;</span>
                <span class="token assign-left variable">enable_channel_flag</span><span class="token operator">=</span><span class="token string">&quot;--set-enabled&quot;</span>
                <span class="token assign-left variable">disable_channel_flag</span><span class="token operator">=</span><span class="token string">&quot;--set-disabled&quot;</span>
                <span class="token assign-left variable">pre_reqs</span><span class="token operator">=</span><span class="token string">&quot;dnf-plugins-core&quot;</span>
                <span class="token assign-left variable">pkg_suffix</span><span class="token operator">=</span><span class="token string">&quot;fc<span class="token variable">$dist_version</span>&quot;</span>
            <span class="token keyword">else</span>
                <span class="token assign-left variable">pkg_manager</span><span class="token operator">=</span><span class="token string">&quot;yum&quot;</span>
                <span class="token assign-left variable">config_manager</span><span class="token operator">=</span><span class="token string">&quot;yum-config-manager&quot;</span>
                <span class="token assign-left variable">enable_channel_flag</span><span class="token operator">=</span><span class="token string">&quot;--enable&quot;</span>
                <span class="token assign-left variable">disable_channel_flag</span><span class="token operator">=</span><span class="token string">&quot;--disable&quot;</span>
                <span class="token assign-left variable">pre_reqs</span><span class="token operator">=</span><span class="token string">&quot;yum-utils&quot;</span>
                <span class="token assign-left variable">pkg_suffix</span><span class="token operator">=</span><span class="token string">&quot;el&quot;</span>
            <span class="token keyword">fi</span>
            <span class="token punctuation">(</span>
                <span class="token keyword">if</span> <span class="token operator">!</span> is_dry_run<span class="token punctuation">;</span> <span class="token keyword">then</span>
                    <span class="token builtin class-name">set</span> -x
                <span class="token keyword">fi</span>
                <span class="token variable">$sh_c</span> <span class="token string">&quot;<span class="token variable">$pkg_manager</span> install -y -q <span class="token variable">$pre_reqs</span>&quot;</span>
                <span class="token variable">$sh_c</span> <span class="token string">&quot;<span class="token variable">$config_manager</span> --add-repo <span class="token variable">$yum_repo</span>&quot;</span>

                <span class="token keyword">if</span> <span class="token punctuation">[</span> <span class="token string">&quot;<span class="token variable">$CHANNEL</span>&quot;</span> <span class="token operator">!=</span> <span class="token string">&quot;stable&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
                    <span class="token variable">$sh_c</span> <span class="token string">&quot;<span class="token variable">$config_manager</span> <span class="token variable">$disable_channel_flag</span> docker-ce-*&quot;</span>
                    <span class="token variable">$sh_c</span> <span class="token string">&quot;<span class="token variable">$config_manager</span> <span class="token variable">$enable_channel_flag</span> docker-ce-<span class="token variable">$CHANNEL</span>&quot;</span>
                <span class="token keyword">fi</span>
                <span class="token variable">$sh_c</span> <span class="token string">&quot;<span class="token variable">$pkg_manager</span> makecache&quot;</span>
            <span class="token punctuation">)</span>
            <span class="token assign-left variable">pkg_version</span><span class="token operator">=</span><span class="token string">&quot;&quot;</span>
            <span class="token keyword">if</span> <span class="token punctuation">[</span> -n <span class="token string">&quot;<span class="token variable">$VERSION</span>&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
                <span class="token keyword">if</span> is_dry_run<span class="token punctuation">;</span> <span class="token keyword">then</span>
                    <span class="token builtin class-name">echo</span> <span class="token string">&quot;# WARNING: VERSION pinning is not supported in DRY_RUN&quot;</span>
                <span class="token keyword">else</span>
                    <span class="token assign-left variable">pkg_pattern</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span><span class="token builtin class-name">echo</span> <span class="token string">&quot;<span class="token variable">$VERSION</span>&quot;</span> <span class="token operator">|</span> <span class="token function">sed</span> <span class="token string">&quot;s/-ce-/<span class="token entity" title="\\">\\</span><span class="token entity" title="\\">\\</span>.ce.*/g&quot;</span> <span class="token operator">|</span> <span class="token function">sed</span> <span class="token string">&quot;s/-/.*/g&quot;</span><span class="token variable">)</span></span>.*<span class="token variable">$pkg_suffix</span>&quot;</span>
                    <span class="token assign-left variable">search_command</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable">$pkg_manager</span> list --showduplicates &apos;docker-ce&apos; | grep &apos;<span class="token variable">$pkg_pattern</span>&apos; | tail -1 | awk &apos;{print \<span class="token variable">$2</span>}&apos;&quot;</span>
                    <span class="token assign-left variable">pkg_version</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span>$sh_c <span class="token string">&quot;<span class="token variable">$search_command</span>&quot;</span><span class="token variable">)</span></span>&quot;</span>
                    <span class="token builtin class-name">echo</span> <span class="token string">&quot;INFO: Searching repository for VERSION &apos;<span class="token variable">$VERSION</span>&apos;&quot;</span>
                    <span class="token builtin class-name">echo</span> <span class="token string">&quot;INFO: <span class="token variable">$search_command</span>&quot;</span>
                    <span class="token keyword">if</span> <span class="token punctuation">[</span> -z <span class="token string">&quot;<span class="token variable">$pkg_version</span>&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
                        <span class="token builtin class-name">echo</span>
                        <span class="token builtin class-name">echo</span> <span class="token string">&quot;ERROR: &apos;<span class="token variable">$VERSION</span>&apos; not found amongst <span class="token variable">$pkg_manager</span> list results&quot;</span>
                        <span class="token builtin class-name">echo</span>
                        <span class="token builtin class-name">exit</span> <span class="token number">1</span>
                    <span class="token keyword">fi</span>
                    <span class="token assign-left variable">search_command</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable">$pkg_manager</span> list --showduplicates &apos;docker-ce-cli&apos; | grep &apos;<span class="token variable">$pkg_pattern</span>&apos; | tail -1 | awk &apos;{print \<span class="token variable">$2</span>}&apos;&quot;</span>
                    <span class="token comment"># It&apos;s okay for cli_pkg_version to be blank, since older versions don&apos;t support a cli package</span>
                    <span class="token assign-left variable">cli_pkg_version</span><span class="token operator">=</span><span class="token string">&quot;<span class="token variable"><span class="token variable">$(</span>$sh_c <span class="token string">&quot;<span class="token variable">$search_command</span>&quot;</span> <span class="token operator">|</span> <span class="token function">cut</span> -d<span class="token string">&apos;:&apos;</span> -f <span class="token number">2</span><span class="token variable">)</span></span>&quot;</span>
                    <span class="token comment"># Cut out the epoch and prefix with a &apos;-&apos;</span>
                    <span class="token assign-left variable">pkg_version</span><span class="token operator">=</span><span class="token string">&quot;-<span class="token variable"><span class="token variable">$(</span><span class="token builtin class-name">echo</span> <span class="token string">&quot;<span class="token variable">$pkg_version</span>&quot;</span> <span class="token operator">|</span> <span class="token function">cut</span> -d<span class="token string">&apos;:&apos;</span> -f <span class="token number">2</span><span class="token variable">)</span></span>&quot;</span>
                <span class="token keyword">fi</span>
            <span class="token keyword">fi</span>
            <span class="token punctuation">(</span>
                <span class="token keyword">if</span> <span class="token operator">!</span> is_dry_run<span class="token punctuation">;</span> <span class="token keyword">then</span>
                    <span class="token builtin class-name">set</span> -x
                <span class="token keyword">fi</span>
                <span class="token comment"># install the correct cli version first</span>
                <span class="token keyword">if</span> <span class="token punctuation">[</span> -n <span class="token string">&quot;<span class="token variable">$cli_pkg_version</span>&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
                    <span class="token variable">$sh_c</span> <span class="token string">&quot;<span class="token variable">$pkg_manager</span> install -y -q docker-ce-cli-<span class="token variable">$cli_pkg_version</span>&quot;</span>
                <span class="token keyword">fi</span>
                <span class="token variable">$sh_c</span> <span class="token string">&quot;<span class="token variable">$pkg_manager</span> install -y -q docker-ce<span class="token variable">$pkg_version</span>&quot;</span>
            <span class="token punctuation">)</span>
            echo_docker_as_nonroot
            <span class="token builtin class-name">exit</span> <span class="token number">0</span>
            <span class="token punctuation">;</span><span class="token punctuation">;</span>
        *<span class="token punctuation">)</span>
            <span class="token keyword">if</span> <span class="token punctuation">[</span> -z <span class="token string">&quot;<span class="token variable">$lsb_dist</span>&quot;</span> <span class="token punctuation">]</span><span class="token punctuation">;</span> <span class="token keyword">then</span>
                <span class="token keyword">if</span> is_darwin<span class="token punctuation">;</span> <span class="token keyword">then</span>
                    <span class="token builtin class-name">echo</span>
                    <span class="token builtin class-name">echo</span> <span class="token string">&quot;ERROR: Unsupported operating system &apos;macOS&apos;&quot;</span>
                    <span class="token builtin class-name">echo</span> <span class="token string">&quot;Please get Docker Desktop from https://www.docker.com/products/docker-desktop&quot;</span>
                    <span class="token builtin class-name">echo</span>
                    <span class="token builtin class-name">exit</span> <span class="token number">1</span>
                <span class="token keyword">fi</span>
            <span class="token keyword">fi</span>
            <span class="token builtin class-name">echo</span>
            <span class="token builtin class-name">echo</span> <span class="token string">&quot;ERROR: Unsupported distribution &apos;<span class="token variable">$lsb_dist</span>&apos;&quot;</span>
            <span class="token builtin class-name">echo</span>
            <span class="token builtin class-name">exit</span> <span class="token number">1</span>
            <span class="token punctuation">;</span><span class="token punctuation">;</span>
    <span class="token keyword">esac</span>
    <span class="token builtin class-name">exit</span> <span class="token number">1</span>
<span class="token punctuation">}</span>

<span class="token comment"># wrapped up in a function so that we have some protection against only getting</span>
<span class="token comment"># half the file during &quot;curl | sh&quot;</span>
do_install
</code></pre>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; caixisheng 2017 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2021-05-27 21:01:52
</span></footer> <link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/app.klipse.tech/css/codemirror.css"> <script>     window.klipse_settings = {         selector: ".language-klipse, .lang-eval-clojure",         selector_eval_js: ".lang-eval-js",         selector_eval_python_client: ".lang-eval-python",         selector_eval_php: ".lang-eval-php",         selector_eval_scheme: ".lang-eval-scheme",         selector_eval_ruby: ".lang-eval-ruby",         selector_reagent: ".lang-reagent",        selector_google_charts: ".lang-google-chart",        selector_es2017: ".lang-eval-es2017",        selector_jsx: ".lang-eval-jsx",        selector_transpile_jsx: ".lang-transpile-jsx",        selector_render_jsx: ".lang-render-jsx",        selector_react: ".lang-react",        selector_eval_markdown: ".lang-render-markdown",        selector_eval_lambdaway: ".lang-render-lambdaway",        selector_eval_cpp: ".lang-eval-cpp",        selector_eval_html: ".lang-render-html",        selector_sql: ".lang-eval-sql",        selector_brainfuck: "lang-eval-brainfuck",        selector_js: ".lang-transpile-cljs"    }; </script> <script src="https://storage.googleapis.com/app.klipse.tech/plugin/js/klipse_plugin.js"></script>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="readme.html" class="navigation navigation-prev " aria-label="Previous page: Readme">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../golang/" class="navigation navigation-next " aria-label="Next page: Golang">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"官方Shell","level":"1.5.4","depth":2,"next":{"title":"Golang","level":"1.6","depth":1,"path":"blog/golang/README.md","ref":"blog/golang/README.md","articles":[{"title":"Aop","level":"1.6.1","depth":2,"path":"blog/golang/aop.md","ref":"blog/golang/aop.md","articles":[]},{"title":"Base","level":"1.6.2","depth":2,"path":"blog/golang/base/README.md","ref":"blog/golang/base/README.md","articles":[{"title":"Copy","level":"1.6.2.1","depth":3,"path":"blog/golang/base/copy.md","ref":"blog/golang/base/copy.md","articles":[]},{"title":"New And Make","level":"1.6.2.2","depth":3,"path":"blog/golang/base/new_and_make.md","ref":"blog/golang/base/new_and_make.md","articles":[]},{"title":"Readme","level":"1.6.2.3","depth":3,"path":"blog/golang/base/readme.md","ref":"blog/golang/base/readme.md","articles":[]},{"title":"Reflect","level":"1.6.2.4","depth":3,"path":"blog/golang/base/reflect.md","ref":"blog/golang/base/reflect.md","articles":[]},{"title":"String","level":"1.6.2.5","depth":3,"path":"blog/golang/base/string.md","ref":"blog/golang/base/string.md","articles":[]},{"title":"Tag","level":"1.6.2.6","depth":3,"path":"blog/golang/base/tag.md","ref":"blog/golang/base/tag.md","articles":[]}]},{"title":"Clouser","level":"1.6.3","depth":2,"path":"blog/golang/clouser.md","ref":"blog/golang/clouser.md","articles":[]},{"title":"Err 优雅处理","level":"1.6.4","depth":2,"path":"blog/golang/err 优雅处理.md","ref":"blog/golang/err 优雅处理.md","articles":[]},{"title":"Go Module 2","level":"1.6.5","depth":2,"path":"blog/golang/go module 2.md","ref":"blog/golang/go module 2.md","articles":[]},{"title":"Go Mod","level":"1.6.6","depth":2,"path":"blog/golang/go_mod.md","ref":"blog/golang/go_mod.md","articles":[]},{"title":"Gocraftwork","level":"1.6.7","depth":2,"path":"blog/golang/gocraftwork.md","ref":"blog/golang/gocraftwork.md","articles":[]},{"title":"Oauth","level":"1.6.8","depth":2,"path":"blog/golang/oauth.md","ref":"blog/golang/oauth.md","articles":[]},{"title":"Readme","level":"1.6.9","depth":2,"path":"blog/golang/readme.md","ref":"blog/golang/readme.md","articles":[]},{"title":"Swagger","level":"1.6.10","depth":2,"path":"blog/golang/swagger.md","ref":"blog/golang/swagger.md","articles":[]},{"title":"Tls","level":"1.6.11","depth":2,"path":"blog/golang/tls.md","ref":"blog/golang/tls.md","articles":[]},{"title":"代码走读","level":"1.6.12","depth":2,"ref":"","articles":[{"title":"2020.5.26","level":"1.6.12.1","depth":3,"path":"blog/golang/代码走读/2020.5.26.md","ref":"blog/golang/代码走读/2020.5.26.md","articles":[]}]},{"title":"任务队列","level":"1.6.13","depth":2,"path":"blog/golang/任务队列/README.md","ref":"blog/golang/任务队列/README.md","articles":[{"title":"Gocraft Worker","level":"1.6.13.1","depth":3,"path":"blog/golang/任务队列/gocraft-worker.md","ref":"blog/golang/任务队列/gocraft-worker.md","articles":[]},{"title":"Readme","level":"1.6.13.2","depth":3,"path":"blog/golang/任务队列/readme.md","ref":"blog/golang/任务队列/readme.md","articles":[]}]},{"title":"参数校验","level":"1.6.14","depth":2,"path":"blog/golang/参数校验.md","ref":"blog/golang/参数校验.md","articles":[]}]},"previous":{"title":"Readme","level":"1.5.3","depth":2,"path":"blog/docker/readme.md","ref":"blog/docker/readme.md","articles":[]},"dir":"ltr"},"config":{"plugins":["summary","expandable-chapters","toggle-chapters","theme-comscore","-lunr","-search","-highlight","-livereload","search-plus@^0.0.11","simple-page-toc@^0.1.1","github@^2.0.0","github-buttons@2.1.0","edit-link@^2.0.2","disqus@^0.1.0","prism@^2.1.0","prism-themes@^0.0.2","advanced-emoji@^0.2.1","anchors@^0.7.1","include-codeblock@^3.0.2","emphasize@^1.1.0","katex@^1.1.3","splitter@^0.0.8","mermaid-gb3@2.1.0","tbfed-pagefooter@^0.0.1","expandable-chapters-small@^0.1.7","sectionx@^3.1.0","donate@^1.0.2","local-video@^1.0.1","anchor-navigation-ex@0.1.8","favicon@^0.0.2","3-ba@^0.9.0","terminal@^0.3.2","alerts@^0.2.0","include-csv@^0.1.0","puml@^1.0.1","musicxml@^1.0.2","klipse@^1.2.0","versions-select@^0.1.1","-sharing","sharing-plus@^0.0.2","graph@^0.1.0","chart@^0.2.0"],"root":".","styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright © caixisheng 2017","modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"prism":{"css":["prism-themes/themes/prism-base16-ateliersulphurpool.light.css"]},"include-csv":{},"disqus":{"useIdentifier":false,"shortName":"gitbookuse"},"emphasize":{},"github":{"url":"https://github.com/xishengcai/xisheng.blog"},"puml":{},"simple-page-toc":{"maxDepth":3,"skipFirstH1":true},"summary":{},"splitter":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"versions-select":{"type":"branches"},"graph":{},"donate":{"alipay":"https://cai-hello-1253732611.cos.ap-shanghai.myqcloud.com/share/zhifubao-pay.jpg","alipayText":"支付宝打赏","button":"赏","title":"","wechat":"https://cai-hello-1253732611.cos.ap-shanghai.myqcloud.com/share/weixin-pay.jpg","wechatText":"微信打赏"},"katex":{},"fontsettings":{"theme":"white","family":"sans","size":2},"musicxml":{},"sectionx":{"tag":"b"},"mermaid-gb3":{},"anchor-navigation-ex":{"isRewritePageTitle":false,"tocLevel1Icon":"fa fa-hand-o-right","tocLevel2Icon":"fa fa-hand-o-right","tocLevel3Icon":"fa fa-hand-o-right"},"favicon":{"shortcut":"favicon.ico","bookmark":"favicon.ico"},"theme-comscore":{},"prism-themes":{},"alerts":{},"github-buttons":{"repo":"xishengcai/xisheng.blog","types":["star"],"size":"small"},"3-ba":{"configuration":"auto","token":"ff100361cdce95dd4c8fb96b4009f7bc"},"expandable-chapters-small":{},"local-video":{},"klipse":{"myConfigKey":"it's the default value"},"advanced-emoji":{"embedEmojis":false},"include-codeblock":{"check":false,"edit":true,"fixlang":false,"lang":"","template":"ace","theme":"chrome","unindent":true},"sharing":{"qq":false,"all":["facebook","google","twitter","weibo","instapaper","linkedin","pocket","stumbleupon","qq","qzone"],"douban":false,"facebook":false,"weibo":true,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":false,"messenger":false,"line":false,"vk":false,"pocket":false,"google":true,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":true},"terminal":{"copyButtons":true,"fade":false,"style":"flat"},"edit-link":{"label":"Edit This Page","base":"https://github.com/xishengcai/xisheng.blog/edit/master"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"anchors":{},"chart":{"type":"c3"},"toggle-chapters":{},"expandable-chapters":{},"search-plus":{}},"theme":"default","author":"xishengcai","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"这是程序员吗","language":"zh-hans","output.name":"site","links":{"sidebar":{"Home":"https://xisheng.vip"}},"gitbook":"3.2.3","description":"这是程序员吗"},"file":{"path":"blog/docker/官方shell.md","mtime":"2021-05-27T13:01:52.596Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-06-23T07:51:54.455Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-toggle-chapters/toggle.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.16.1/URI.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-disqus/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-mermaid-gb3/book/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sectionx/sectionx.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-donate/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-local-video/video.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-3-ba/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-terminal/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-alerts/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-musicxml/osmd.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-musicxml/musicxml.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-musicxml/promise.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-versions-select/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-theme-comscore/test.js"></script>
        
    

    <script src="../../gitbook/gitbook-plugin-mermaid-gb3/mermaid/mermaid.min.js"></script>

    </body>
</html>

